<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>列表</title>
<link href="resources/styles/cms.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script language="javascript">
	function changeinput(id){
		var obj_id = $('#'+id);
		var idhtml = obj_id.html();
		input_str = '<input name="'+id+'" value="'+idhtml+'" onblur="javascript:blurvalue(this)" onchange="javascript:changevalue(this)"/>';
		obj_id.html(input_str);
		obj_id.attr("onclick",'');
		obj_id.find('input').focus();
	}
	
	function blurvalue(obj){
		var input_value = obj.value;
		var obj_id = $('#'+obj.name);
		obj_id.html(input_value);
		obj_id.attr("onclick",'changeinput(this.id)');
	}
	
	function changevalue(obj){
		var input_name = obj.name;
		var input_value = obj.value;
		$.get("<{$domain}>index.php?act=area.update",{name:input_name,value:input_value},
  		function(data){
    		if(data == 2){
				alert('三位数');
			}else if(data == 3){
				alert('已存在');
			}
  		}); 
	}
	
</script>

<style type="text/css">
body {
	background-image: url(resources/images/tab_shadow.gif);
	background-attachment: fixed;
	background-repeat: repeat-x;
}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="search_box">
<tr><td class="search_box">
	<form action="<{$domain}>?act=package.list" method="post">
	渠道号：<input name="channel_id" type="text" value="<{$out.channel_id}>" />&nbsp;<input name="page" type="hidden" value="<{$out.page}>" />
	发行地区：<select name="area" style="width:150px">
				<{section name=area loop=$out.channel_country}>
				<option value="<{$out.channel_country[area].country_num}>" <{if $out.area_num eq $out.channel_country[area].country_num}>selected<{/if}>><{$out.channel_country[area].country_cn}></option>
                <{/section}>
			</select>
	<input type="hidden" name="is_search" value="1" />
	&nbsp;&nbsp;&nbsp;<input type="submit" value="搜索"/>
	</form>
</td></tr>
</table>

<table width="100%"  border="0" cellpadding="2" cellspacing="1" class="color-tabletrim">
  <tr> 
    <td colspan="8" class="j"><img src="resources/images/file.gif" width="14" height="14" border="0" align="absmiddle" />&nbsp;&nbsp;渠道包列表</td>
  </tr>
  <tr > 
    <td width="50" class="e">渠道号</td>
    <td class="e">推广渠道</td>
    <td class="e">发行地区</td>
	<td class="e">推广地址</td>
	<td class="e">备注</td>
	<td class="e">创建时间</td>
	<td class="e">操作</td>
  </tr>
  <{section name=i loop=$out.data}> 
  <tr onMouseOut="javascript:this.bgColor='#FFFFFF'" bgColor="#f8f8f8"> 
    <td class="c_lick" style="height:22px;text-align:center;" ><{$out.data[i].channel_id}><{if $out.is_admin eq 1}><br/><{$out.data[i].role_name}><br/><{$out.data[i].user_name}><{/if}></td>
    <td class="c_lick" >&nbsp;<{$out.data[i].channel_coo}></td>
    <td class="c_lick" ><{$out.data[i].country_cn}></td>
	<td class="c_lick">
		<{section name=j loop=$out.data[i].channel_url}>
			<{$out.data[i].channel_url[j].coo_url}><br />
		<{/section}>
	</td>
	<td class="c_lick" ><{if $out.data[i].is_download_url eq 1}>跳转下载<{elseif $out.data[i].is_bind eq 1}>捆绑包<{else}>非捆绑包<{/if}></td>
	<td class="c_lick"><{$out.data[i].addtime|date_format:"%Y-%m-%d %H:%M:%S"}></td>
	<td class="c_lick"><a href="<{$domain}>?act=package.update&channel_id=<{$out.data[i].channel_id}>">修改</a></td>
  </tr>
  <{/section}> 
</table>
<{$out.pagestring}>
</body>
</html>
